from frappe.database.mariadb.database import MariaDBDatabase


def setup_type_map(self):
    self.db_type = "mariadb"
    self.type_map = {
        "Currency": ("decimal", "21,9"),
        "Int": ("int", "11"),
        "Long Int": ("bigint", "20"),
        "Float": ("decimal", "21,9"),
        "Percent": ("decimal", "21,9"),
        "Check": ("int", "1"),
        "Small Text": ("text", ""),
        "Long Text": ("longtext", ""),
        "Code": ("longtext", ""),
        "Text Editor": ("longtext", ""),
        "Markdown Editor": ("longtext", ""),
        "HTML Editor": ("longtext", ""),
        "Date": ("date", ""),
        "Datetime": ("datetime", "6"),
        "Time": ("time", "6"),
        "Text": ("text", ""),
        "Data": ("varchar", self.VARCHAR_LEN),
        "Link": ("varchar", self.VARCHAR_LEN),
        'Link MultiSelect':	('varchar', self.VARCHAR_LEN),
        "Dynamic Link": ("varchar", self.VARCHAR_LEN),
        "Password": ("text", ""),
        "Select": ("varchar", self.VARCHAR_LEN),
        "Rating": ("decimal", "3,2"),
        "Read Only": ("varchar", self.VARCHAR_LEN),
        "Attach": ("text", ""),
        "Attach Image": ("text", ""),
        "Signature": ("longtext", ""),
        "Color": ("varchar", self.VARCHAR_LEN),
        "Barcode": ("longtext", ""),
        "Geolocation": ("longtext", ""),
        "Duration": ("decimal", "21,9"),
        "Icon": ("varchar", self.VARCHAR_LEN),
        "Phone": ("varchar", self.VARCHAR_LEN),
        "Autocomplete": ("varchar", self.VARCHAR_LEN),
        "JSON": ("json", ""),
    }

MariaDBDatabase.setup_type_map = setup_type_map